package com.pzhu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pzhu.model.entity.Review;
import com.pzhu.model.vo.ReviewVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author : zqh
 * @Date : 2023/12/14 0014 下午 11:11
 * @Version: 1.0
 */
public interface ReviewMapper extends BaseMapper<Review> {

    @Select("SELECT v.id,u.username,v.avatar,match_star,stand_star,level_star,content, v.create_time, v.update_time " +
            "FROM hs_thali st, hs_review v, hs_user u" +
            "      WHERE st.id = v.thali_id AND v.user_id = u.id AND st.id = #{id}")
    List<ReviewVo> selectInfo(@Param("id") Long id);

    @Select(" SELECT url from hs_review v , hs_review_image ri" +
            "        WHERE  ri.review_id = #{id}")
    List<String> selectPhoto(Long id);
}
